<style xmlns="http://www.w3.org/1999/html">
    .payment-type td .layui-form-checkbox {
        margin: 0 !important;
        padding-left: 25px !important;
    }

    .payment-type td .layui-form-switch {
        margin: 0 !important;
    }

    .transfer-image {
        padding: 5px 10px 0 10px !important;
    }

    .transfer-image .uploadimage {
        width: 35px;
        height: 35px;
    }

    .transfer-image .uploadimage span.layui-icon {
        display: none !important;
    }
</style>

<form action="{:request()->url()}" autocomplete="off" class="layui-form layui-card" data-auto="true" method="post">
    <div class="layui-card-body padding-left-40">

        <div class="layui-form-item relative block">
            <span class="color-green font-w7 label-required-prev">用户提现状态</span>
            <span class="color-desc margin-left-5">Transfer Status</span>
            <div class="layui-textarea" style="min-height:auto;padding:10px 0 13px 18px">
                {php} $data['status'] = $data['status'] ?? 0; {/php}
                {foreach ['关闭返利提现', '开启返利提现'] as $k => $v}
                {if $data.status eq $k}
                <input checked class="layui-input layui-bg-gray" name="status" title="{$v}" type="radio" value="{$k}">
                {else}
                <input class="layui-input layui-bg-gray" name="status" title="{$v}" type="radio" value="{$k}">
                {/if}{/foreach}
            </div>
        </div>

        <label class="layui-form-item relative block">
            <span class="color-green font-w7 label-required-prev">提现手续费配置</span>
            <span class="color-desc margin-left-5">Transfer Charge</span>
            <input class='layui-input' data-blur-number="4" data-value-max="50.0000" data-value-min="0.0000" name="charge" value='{$data.charge|default="0.0000"}'>
            <span class='help-block'>请输入提现金额的百分比，费率的取值范围为 0.0000% - 50.0000%</span>
        </label>

        <div class="layui-form-item">
            <span class="color-green font-w7 label-required-prev">提现方式状态配置</span>
            <span class="color-desc margin-left-5">Transfer Types</span>
            <table class="layui-table payment-type" lay-skin="nob">
                <thead>
                <tr>
                    <th class="text-center notselect nowrap padding-col-5"><b>提现转账方式</b></th>
                    <td class="text-center notselect nowrap padding-col-5"><b>是否需要审核</b></td>
                    <td class="text-center notselect nowrap padding-col-5"><b>图 标</b></td>
                    <td class="text-center notselect nowrap padding-col-5"><b>单笔最小金额（ 元 ）</b></td>
                    <td class="padding-col-0"></td>
                    <td class="text-center notselect nowrap padding-col-5"><b>单笔最大金额（ 元 ）</b></td>
                    <td class="text-center notselect nowrap padding-col-5"><b>每日限提现次数</b></td>
                </tr>
                </thead>
                <tbody>
                {foreach $types as $k => $t}
                <tr class="think-bg-white">
                    <td class="nowrap padding-col-5">
                        {php} $key = 'transfer['.$k.']["state"]'; {/php}
                        <input name="{$key}" type="hidden" value="0">
                        {if isset($data['transfer'][$k]['state']) and $data['transfer'][$k]['state'] eq 1}
                        <input checked lay-skin="primary" name="{$key}" title="{$t}" type="checkbox" value="1">
                        {else}
                        <input lay-skin="primary" name="{$key}" title="{$t}" type="checkbox" value="1">
                        {/if}
                    </td>
                    <td class="text-center padding-col-5" style="width:80px">
                        {php} $key = 'transfer['.$k.']["audit"]'; {/php}
                        <input name="{$key}" type="hidden" value="0">
                        {if isset($data['transfer'][$k]['audit']) and $data['transfer'][$k]['audit'] eq 1}
                        <input checked lay-skin="switch" lay-text="需审核|免审核" name="{$key}" type="checkbox" value="1">
                        {else}
                        <input lay-skin="switch" lay-text="需审核|免审核" name="{$key}" type="checkbox" value="1">
                        {/if}
                        {php} $key = 'transfer['.$k.'][title]'; {/php}
                        <input class="layui-input" name="{$key}" type="hidden" value="{$t}">
                    </td>
                    <td class="text-center transfer-image">
                        {php} $key = 'transfer['.$k.'][image]'; {/php}
                        <input name="{$key}" type="hidden" value="{$data['transfer'][$k]['image'] ?? ''}">
                        <script>$("[name='{$key}']").uploadOneImage()</script>
                    </td>
                    <td class="text-center padding-col-5">
                        <label>
                            {php} $key = 'transfer['.$k.'][minAmount]'; {/php}
                            <input class="layui-input" data-blur-number="2" data-value-min="0.00" name="{$key}" placeholder="￥" value="{$data['transfer'][$k]['minAmount'] ?? '1.00'}">
                        </label>
                    </td>
                    <td class="text-center padding-col-5">-</td>
                    <td class="text-center padding-col-5">
                        <label>
                            {php} $key = 'transfer['.$k.'][maxAmount]'; {/php}
                            <input class="layui-input" data-blur-number="2" data-value-max="100000.00" name="{$key}" placeholder="￥" value="{$data['transfer'][$k]['maxAmount'] ?? '2000.00'}">
                        </label>
                    </td>
                    <td class="text-center padding-col-5">
                        <label>
                            {php} $key = 'transfer['.$k.'][dayNumber]'; {/php}
                            <input class="layui-input text-center padding-left-0" data-blur-number="0" data-value-max="100" data-value-min="1" name="{$key}" value="{$data['transfer'][$k]['dayNumber'] ?? '1'}">
                        </label>
                    </td>
                </tr>
                {/foreach}
                </tbody>
            </table>
        </div>

        <div class="layui-form-item relative block">
            <span class="color-green font-w7">用户提现描述内容</span>
            <span class="color-desc margin-left-5">Transfer Remark</span>
            <label class="relative block">
                <textarea class="layui-textarea" name="remark" placeholder="请输入用户提现描述内容">{$data.remark|default=''}</textarea>
            </label>
        </div>

    </div>

    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" data-close data-confirm="确定要取消编辑吗？" type='button'>取消编辑</button>
    </div>

    <script>layui.form.render();</script>
</form>